From: Aaron Schulz Date: Wed, 17 Sep 2008 12:31:57 +0000 (+0000) Subject: *Should need to escape twice X-Git-Tag: 1.31.0-rc.0~45247 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=aad32645ce26b1a28e7374f19412caf4cb16a08d;p=lhc%2Fweb%2Fwiklou.git *Should need to escape twice *Use single quotes on windows, as it goes to cygwin --- diff --git a/includes/Math.php b/includes/Math.php index 8ba35d077c..a21527ba09 100644 --- a/includes/Math.php +++ b/includes/Math.php @@ -57,15 +57,16 @@ class MathRenderer { if( function_exists( 'is_executable' ) && !is_executable( $wgTexvc ) ) { return $this->_error( 'math_notexvc' ); } - $cmd = $wgTexvc . ' ' . - wfEscapeShellArg( $wgTmpDirectory ).' '. - wfEscapeShellArg( $wgTmpDirectory ).' '. - wfEscapeShellArg( $this->tex ).' '. + $delim = wfIsWindows() ? "' '" : ' '; + $cmd = wfEscapeShellArg( $wgTexvc ) . $delim . + wfEscapeShellArg( $wgTmpDirectory ) . $delim . + wfEscapeShellArg( $wgTmpDirectory ) . $delim . + wfEscapeShellArg( $this->tex ) . $delim . wfEscapeShellArg( $wgInputEncoding ); if ( wfIsWindows() ) { # Invoke it within cygwin sh, because texvc expects sh features in its default shell - $cmd = 'sh -c ' . wfEscapeShellArg( $cmd ); + $cmd = "sh -c $cmd"; } wfDebug( "TeX: $cmd\n" );